﻿using System.Collections.Generic;

namespace NHibernate.Expression.Extensions.Utils {
    public static class EnumerableExtensions {
        public static IEnumerable<T> Prepend<T>(this IEnumerable<T> l, T e) {
            yield return e;
            if (l != null)
                foreach (var i in l)
                    yield return i;
        }

        public static IEnumerable<T> Append<T>(this IEnumerable<T> l, T e) {
            if (l != null)
                foreach (var i in l)
                    yield return i;
            yield return e;
        }
    }
}